//
//  ContactParentViewController.m
//  iBaby365v2
//
//  Created by Kirinrin on 14-7-4.
//  Copyright (c) 2014年 suplus. All rights reserved.
//

#import "ContactParentViewController.h"
#import "TopTabView.h"
#import "ParentListViewController.h"
#import "ChatHistoryViewController.h"
#import "UIAlertView+Kirinrin.h"


@interface ContactParentViewController ()
@property (weak, nonatomic) IBOutlet TopTabView *tabContainerView;
@property (weak, nonatomic) IBOutlet UIView *contentContainerView;

@end

@implementation ContactParentViewController{
    UIImageView *indicatorImageView;
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

- (id)initWithCoder:(NSCoder *)aDecoder{
    NSLog(@"initWithCoder");
    self = [super initWithCoder:aDecoder];
    if (self) {
        UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Main" bundle:nil];
        
        ParentListViewController *parentListViewController = [storyboard instantiateViewControllerWithIdentifier:@"ParentListView"];
//        parentListViewController.title = @"动态";
        
        ChatHistoryViewController *chatHistoryViewController = [storyboard instantiateViewControllerWithIdentifier:@"ChatHistoryView"];
//        chatHistoryViewController.title = @"家长列表";
        
        self.viewControllers = @[chatHistoryViewController, parentListViewController];
        self.selectedIndex = 1;
    }
    return self;
}
-(void)setSelectedIndex:(NSUInteger)index animated:(BOOL)animated
{
    [super setSelectedIndex:index animated:animated];
           NSLog(@"-navigationController-%@-->",self.navigationItem.title);
        NSLog(@"--%@-->",self.selectedViewController.tabBarItem.title);
    [self.navigationItem setTitle: self.selectedViewController.tabBarItem.title];
   
    
}
- (void)viewDidLoad
{
    [super viewDidLoad];
    
}

-(void)viewDidAppear:(BOOL)animated{
}
- (void)viewWillDisappear:(BOOL)animated
{
    [super viewWillDisappear:animated];
    
    [[NSNotificationCenter defaultCenter]removeObserver:self];
}
- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];

}


- (void)imLoginStateChange:(NSNotification *)notification{
    [UIAlertView alertWithMessage:@"IM组件现在处于退出状态，请尝试注销后重新登录。"];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
